fix(procevent): retry interrupted Lavish board polls - #64
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Stop interrupted Lavish board polls from waking firstmate or a second mate. The registered Lavish listen must keep running and retry lavish-axi poll on the same artifact only when the published output is exactly error: Lavish Editor poll response was interrupted with code SERVER_ERROR; arbitrary SERVER_ERROR results must not be retryable. Real feedback, ended, missing, and every other non-interrupt completion must still be captured and publish the ordinary check wake, and the Lavish adapter must not become self-announcing. Keep the generic process-event runner adapter-agnostic. Own the bounded retry policy in the bin/fm-procevent-lavish.sh header and --help; use 12 retries with a five-second default delay, surface the final interrupt after exhaustion, and allow only a bounded test delay override. Test through the public adapter and runner interface with a fake lavish-axi: prove retried interrupts create no captured result and no check wake, feedback after retries captures and wakes normally, exhaustion produces a captured result and wake at the documented bound, and unrelated SERVER_ERROR completes immediately. Update process-event-sources guidance only with a pointer to the adapter-owned policy, do not grow AGENTS.md, do not edit projects/lavish-axi or the Lavish product, do not change Herdr, Moshi, or Grok scroll behavior, and do not retire live board listens. Preserve one-owner documentation, one sentence per line in Markdown, plain dashes, shellcheck-clean bin scripts, public-interface behavioral tests without implementation-source byte assertions, and run the firstmate lint and no-mistakes PR pipeline.
What Changed
pollsubcommand tobin/fm-procevent-lavish.shthat runs the registered blocking Lavish listen and retries only the exact two-lineLavish Editor poll response was interrupted/SERVER_ERRORinterrupt, up to 12 times with a five-second default delay, returning every other result (feedback, ended, missing, arbitrarySERVER_ERROR) immediately and surfacing the final interrupt after exhaustion so the runner still captures and wakes.armto registerfm-procevent-lavish.sh pollinstead oflavish-axi polldirectly, keeping transient interrupts inside the adapter's process while the generic runner stays adapter-agnostic; documented the bounded policy in the script header/--helpand added aFM_PROCEVENT_LAVISH_RETRY_DELAY_SECONDSoverride bounded to 0–60 for deterministic tests.tests/fm-procevent.test.shdriving a fakelavish-axito prove retried interrupts produce no captured result or wake, feedback after retries captures and wakes normally, exhaustion captures and wakes at the documented bound, and an unrelatedSERVER_ERRORcompletes immediately; updatedprocess-event-sources/SKILL.mdwith a pointer to the adapter-owned retry policy.Risk Assessment
✅ Low: Well-bounded, thoroughly tested adapter-local change that satisfies every required intent constraint, leaves the generic runner untouched, and has a verified-correct retry/exhaustion/exact-match algorithm.
Testing
Ran the targeted
tests/fm-procevent.test.shbehavior suite (public adapter + runner interface with a fake lavish-axi); all tests pass including the four intent scenarios — retried interrupts produce no captured result and no check wake, feedback after retries captures and wakes normally, exhaustion captures the final interrupt and wakes at the documented 12-retry bound, and unrelated SERVER_ERROR completes immediately. Supplemented with a manual CLI demonstration of thepollcommand showing retry-then-feedback and immediate non-interrupt exit, plus the documented retry policy in--help. Worktree left clean; no linters run per scope.Evidence: Intent-scenario test transcript
Source: Intent-scenario test transcript
ok - exact poll interrupts are retried without wakes before real feedback ok - exact poll interrupt retries are bounded and exhaustion stays visible ok - arbitrary SERVER_ERROR results are never retried all procevent tests passedEvidence: Manual poll CLI demo (retry vs immediate)
Evidence: Adapter --help retry policy
Source: Adapter --help retry policy
poll: exact two-line "poll response was interrupted" SERVER_ERROR retried up to 12 times, waiting five seconds between attempts; every other result returns immediately; final exact interrupt returns after exhaustion.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-procevent.test.sh— full adapter/runner behavior suite, all passok - exact poll interrupts are retried without wakes before real feedback(no captured result, no check wake during retries; feedback captured +procevent lavish <id> 1wake after)ok - exact poll interrupt retries are bounded and exhaustion stays visible(stops at 13 total poll attempts, final interrupt captured + wake)ok - arbitrary SERVER_ERROR results are never retried(single poll call, captured + wake immediately)--helpassertions:poll response was interruptedandup to 12present in operator-facing helpManual CLI:fm-procevent-lavish.sh poll <artifact>with fake lavish-axi — exact interrupt retried twice then real feedback (3 calls, exit 0); arbitrary SERVER_ERROR returned immediately (1 call, exit 1)✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.